<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>


    <script>
        // 箭头函数
        var fn1 = () => {
            return 1;
        }

        // 同等于
        function fn2() {
            return 2;
        }

        alert("var fn1 = () => {\nreturn 1;\n}\n返回值" + fn1());
        alert("var fn2 = () => {\nreturn 2;\n}\n返回值" + fn2());

        const obj1 = {
            name: "John",
            age: 30
        };
        const obj2 = {
            job: "developer",
            salary: 5000
        };

        const newObj = {...obj1,
            ...obj2
        };

        console.log(newObj); // { name: 'John', age: 30, job: 'developer', salary: 5000 }
    </script>
</body>

</html>